import { ref, onBeforeMount } from "vue";

export function useAutoHeightMixin() {
    let autoHeight = ref(0)
    let HeightX = ref(0.25)

    function updateHeight() {
        autoHeight.value = `${ Math.ceil(window.innerHeight * HeightX) }px`;
    }
    onBeforeMount( () => {
        updateHeight();
        console.log("on before mixin mount, height:", autoHeight.value)
    })

    return {
        autoHeight,
        updateHeight
    }
}

